/**
 * 
 */
package com.antilia.infomaresme.pages;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.ResourceModel;

import com.antilia.infomaresme.InfomaresmeApplication;
import com.antilia.infomaresme.InfomaresmeSession;
import com.antilia.infomaresme.link.JQIcon;
import com.antilia.infomaresme.link.JqAjaxLink;

/**
 * @author Ernesto
 *
 */
public class LogOutPanel extends Panel {

	private static final long serialVersionUID = 1L;

	/**
	 * @param id
	 */
	public LogOutPanel(String id) {
		super(id);
		JqAjaxLink logOut = new JqAjaxLink("logOut", JQIcon.ui_icon_close, new ResourceModel("logOut")) {
			
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick(AjaxRequestTarget target) {
				InfomaresmeSession.getSession().setUserId(null);
				setResponsePage(InfomaresmeApplication.getQAApplication().getHomePage());
			}
		};
		add(logOut);
	}

}
